<template>
	<view>
		<!-- 头部导航 -->
		<page-header :headInfo="headInfo"></page-header>
		<view>
			<textarea v-model="feedbackValue" placeholder="请输入反馈内容" maxlength="100" class="feedback-content"/>
			<button class="feedback-btn round bg-blue shadow" @click="clickSubmit" :loading="isLoading" :disabled="isLoading">提交</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				headInfo:{
					title:'反馈中心',
				},
				feedbackValue:'',
				isLoading:false
			}
		},
		onLoad(option) {
			console.log(option);
		},
		/**
		 * @author smallfour
		 * @description 分享好友
		 */
		onShareAppMessage(res){
			return {
				title:'四叶图集',
				imageUrl:'http://image.hermit.love/IMG_3494.JPG',
				path:'/pages/tabBar/index'
			}
		},
		/**
		 * @author smallfour
		 * @description 分享朋友圈
		 */
		onShareTimeline(){
			return {
				title:'四叶图集',
				imageUrl:'http://image.hermit.love/IMG_3494.JPG',
				path:'/pages/tabBar/index'
			}
		},
		
		methods: {
			/**
			 * @author smallfour
			 * @desciption 提交反馈内容
			 */
			clickSubmit:function(){
				if(!this.feedbackValue){
					this.msg('请填写反馈内容');
					return;
				}
				this.isLoading = true;
				// 反馈
				this.$api.atalsFeedback({content:this.feedbackValue}).then(res => {
					this.msg(res.errmsg);
					this.isLoading = false;
					uni.navigateBack();
				}).catch(err => {
					console.log(err);
				})
			}
		}
	}
</script>

<style>
	.feedback-content{
		width: calc(100% - 60rpx);
		margin: 30rpx;
		border: 1px solid #cacaca;
		border-radius: 10rpx;
		padding: 10rpx;
	}
	.feedback-btn{
		margin: 0 30rpx;
	}
</style>
